package demo.servlet;

import server.base.HttpRequest;
import server.base.HttpResponseUtil;
import server.base.HttpServlet;
import server.base.HttpResponse;

import java.io.IOException;

/**
 * @ClassName DemoOneServlet
 * @Description TODO
 * @Auth ying.xiao
 * @Date 2021/3/11
 * @Version 1.0.0
 */
public class DemoOneServlet extends HttpServlet {

    protected void doPost(HttpRequest request, HttpResponse response) throws IOException {
        System.out.println("I am demo1,I am running……");
        String context = "I am demo1,I am running";
        response.output(HttpResponseUtil.getHttpHeader200(context.getBytes().length)+context);
    }

    protected void doGet(HttpRequest request, HttpResponse response) throws IOException {
        doPost(request,response);
    }
}
